Skip to content

[fix] Select Railway services when redeploying previews#4725

Open
mmabrouk wants to merge 1 commit into
release/v0.104.0from
fix/railway-explicit-redeploy-service
Open

[fix] Select Railway services when redeploying previews#4725
mmabrouk wants to merge 1 commit into
release/v0.104.0from
fix/railway-explicit-redeploy-service

Conversation

@mmabrouk

@mmabrouk mmabrouk commented Jun 17, 2026

Copy link
Copy Markdown
Member

Context

Railway preview deploys started failing after setup with No deployment found for service. The deploy script checked Postgres but then ran a bare railway redeploy --yes, which depends on the CLI's currently linked service. The current Railway CLI exposes explicit --service selection and treats the old implicit service form as deprecated, so the bare redeploy can target a service with no deployment, such as gateway, before the script reaches Alembic or app deployment.

Changes

Redeploy calls now pass the intended service and environment directly.

Before:

railway service "$POSTGRES_SERVICE" >/dev/null && railway redeploy --yes

After:

railway service "$POSTGRES_SERVICE" >/dev/null && railway redeploy --service "$POSTGRES_SERVICE" --environment "$ENV_NAME" --yes

The same explicit selector is used for the image-based preview deploy helper and smoke-test auto-repair paths, so no path relies on mutable Railway CLI service state for redeploys.

Tests / notes

  • bash -n hosting/railway/oss/scripts/deploy-from-images.sh hosting/railway/oss/scripts/deploy-services.sh hosting/railway/oss/scripts/smoke.sh
  • git diff --check -- hosting/railway/oss/scripts/deploy-from-images.sh hosting/railway/oss/scripts/deploy-services.sh hosting/railway/oss/scripts/smoke.sh
  • Verified the failing run failed before Alembic/API/web deploy at the bare redeploy step with Railway CLI 5.15.0.

@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jun 17, 2026
@vercel

vercel Bot commented Jun 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview, Comment Jun 17, 2026 6:48pm

Request Review

@dosubot dosubot Bot added bug Something isn't working devops labels Jun 17, 2026
@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9b2ca123-6069-45e9-9eaa-457bc6bcabd4

📥 Commits

Reviewing files that changed from the base of the PR and between 5722ff7 and 492a8b4.

📒 Files selected for processing (3)
  • hosting/railway/oss/scripts/deploy-from-images.sh
  • hosting/railway/oss/scripts/deploy-services.sh
  • hosting/railway/oss/scripts/smoke.sh

📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Improved deployment process consistency by ensuring services redeploy in the designated environment across all operations.

Walkthrough

Three Railway OSS hosting scripts are updated to pass --environment "$ENV_NAME" explicitly to every railway redeploy invocation: the generic helper in deploy-from-images.sh, the Postgres redeploy in deploy-services.sh, and the three auto-repair redeployments in smoke.sh.

Changes

Explicit Railway environment targeting for redeploys

Layer / File(s) Summary
Add --environment to all redeploy invocations
hosting/railway/oss/scripts/deploy-from-images.sh, hosting/railway/oss/scripts/deploy-services.sh, hosting/railway/oss/scripts/smoke.sh
redeploy_service_if_exists gains --service "$service" --environment "$ENV_NAME"; the Postgres redeploy gains --environment "$ENV_NAME" (and drops its separate --yes); each of the three repair_path redeployments in smoke.sh gains --environment "$ENV_NAME".

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 60.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: adding explicit service selection to Railway redeploy commands when redeploying preview services.
Description check ✅ Passed The description is directly related to the changeset, providing clear context, before/after code examples, and validation steps for the Railway service redeploy fix.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/railway-explicit-redeploy-service

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown
Contributor

Railway Preview Environment

Preview URL https://gateway-production-aeab.up.railway.app/w
Project agenta-oss-pr-4725
Image tag pr-4725-dd04719
Status Deployed
Railway logs Open logs
Workflow logs View workflow run
Updated at 2026-06-17T18:59:30.529Z

@mmabrouk mmabrouk changed the base branch from main to release/v0.104.0 June 17, 2026 19:10
@mmabrouk mmabrouk requested a review from jp-agenta June 17, 2026 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working devops size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant